/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Controllers;

import DAO.UserDAO;
import java.util.Map;
import model.UserBean;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 *
 * @author emovabilisim
 */
@Controller
public class AndroidSignInController {
    @RequestMapping(value="/androidlogin.htm")
    public @ResponseBody
    UserBean asdaf(Map model, 
                                  @RequestParam(value="username", required=true) String username,
                                  @RequestParam(value="password", required=true) String password){
        UserBean userBean = new UserBean();
        
        userBean.setUserName(username);
        userBean.setPassword(password);
        
        UserDAO userDAO = new UserDAO();
        userBean = userDAO.login(userBean);
        
        //model.put("userBean",userBean);
        
        return userBean;
    }
}
